<template>
	<view class="page">
		
	<view class="cell_box" v-if="userData.pk_id?true:false">
		<view class="cell_item">
			<view class="title">头像</view>
			<view class="cont"><image class="img" :src="userData.headimgurl"></image></view>
		</view>
		<view class="cell_item">
			<view class="title">账号昵称</view>
			<view class="cont">{{userData.nickname}}</view>
		</view>
		<view class="cell_item" v-if="userData.real_name?true:false">
			<view class="title">姓名</view>
			<view class="cont">{{userData.real_name}}</view>
		</view>
		<view class="cell_item">
			<view class="title">联系电话</view>
			<view class="cont">{{userData.mobile}}</view>
		</view>
		<view class="cell_item">
			<view class="title">会员等级</view>
			<view class="cont">{{userData.level_name}}</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user_id: null,
				userData: {}
			}
		},
		onLoad(options) {
			if (options.id) {
				this.user_id = Number(options.id)
				this.getUserData()
			}
		},
		methods: {
			getUserData() {
				this.$loading()
				this.$resPost('GetUsersInfo',{users_id:this.user_id}).then(({data})=>{
					this.userData = {
						...data
					}
					this.$hide()
				})
			}
		}

	}
</script>
<style>
	page{
		background-color: #F5F5F5;
	}
</style>
<style lang="scss" scoped>
	.page{
		padding: 20rpx;
	}
	.cell_box{
		background-color: #fff;
		border-radius: 10rpx;
		padding: 0 20rpx;
		.cell_item{
			border-bottom: 2rpx solid #f5f5f5;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx 0;
			.title{
				color: #666;
			}
			.img{
				width: 100rpx;
				height: 100rpx;
				background-color: #F5F5F5;
				border-radius: 50%;
			}
		}
	}
</style>
